home *** CD-ROM | disk | FTP | other *** search
-
- #include <exec/exec.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "XIM:doorheader.h"
- #include "XIM:glue.h"
-
- struct User {
- char Name[31],Pass[9],Location[30],PhoneNumber[13];
- USHORT Slot_Number;
- USHORT Sec_Status,
- Sec_Board, /* File or Byte Ratio */
- Sec_Library, /* Ratio */
- Sec_Bulletin, /* Computer Type */
- Messages_Posted;
- /* Note ConfYM = the last msg you actually read, ConfRead is the same ?? */
- ULONG NewSinceDate, ConfRead1, ConfRead2, ConfRead3, ConfRead4,
- ConfRead5;
- UWORD XferProtocol, Filler2;
- UWORD Lcfiles,BadFiles;
- ULONG AccountDate;
- UWORD ScreenType, Filler1;
- char Conference_Access[10];
- USHORT Uploads, Downloads, ConfRJoin, Times_Called;
- long Time_Last_On, Time_Used, Time_Limit, Time_Total;
- ULONG Bytes_Download, Bytes_Upload, Daily_Bytes_Limit, Daily_Bytes_Dld;
- char Expert;
- ULONG ConfYM1, ConfYM2, ConfYM3, ConfYM4, ConfYM5, ConfYM6, ConfYM7,
- ConfYM8, ConfYM9;
- long BeginLogCall;
- UBYTE Protocol, UUCPA, LineLength, New_User;
- };
- struct UserKeys { /* changes to UserKeys (RTS) */
- char UserName[31];
- long Number;
- UBYTE New_User;
- UWORD UPcps; /* highest upload cps rate */
- UWORD DNcps; /* highest dnload cps rate */
- UWORD Userflags; /* */
- UWORD baud_rate; /* last online baud rate */
- char Pad[9]; /* ?? should be 15 */
- };
- struct ConfBase
- {
- char Handle[31];
- ULONG NewSinceDate, ConfRead,ConfYM;
- ULONG Bytes_Download,Bytes_Upload;
- ULONG Daily_Bytes_Limit,Daily_Bytes_Dld;
- USHORT Upload,Downloads,RatioType,Ratio,Messages_Posted;
- UWORD Access;
- UWORD Active;
- };
- struct User U;
- struct UserKeys UK;
- struct ConfBase CB;
- void ShowIntro(void);
- char VaultCfg[200];
- char bbsroot[200];
- ULONG ShowValue(ULONG Value);
- FILE *CreateDataBase(char *s);
- void end(void);
- void LastCommand(void);
- char path[200];
- #define sm sendmessage
- #define gu getuserstring
- #define pm prompt
- #define hk hotkey
- #define pu putuserstring
- main(int argc,char *argv[])
- {
- FILE *fi,*fo;
- register int i;
- int num;
- ULONG Value;
- USHORT ratio;
- USHORT ratiotype;
- ULONG bytelimit;
- char image[100];
- if(argc!=2)
- {
- printf("\n");
- printf("RATIOS version 1.0 , written by Joseph Hodge\n");
- printf("This is a product of the /X Developement Team - The Silent Achievers\n");
- printf("This is a (XIM) for AmiExpress 3.0+\n");
- printf("\n");
- exit(0);
- }
- Register(argv[1][0]-'0');
- gu(bbsroot,BB_CONFLOCAL);
- strcat(bbsroot,"Conf.DB");
- strcpy(path,bbsroot);
- strcat(path,".old");
- ShowIntro();
- sm("",1);
- pm("Enter Conference Ratio Type (0=Byte, 1=File/Byte, 2=File) >: ",image,3);
- switch(image[0])
- {
- case '0': ratiotype=0; break;
- case '1': ratiotype=1; break;
- case '2': ratiotype=2; break;
- default:
- sm("",1);
- sm("Invalid Option.",1);
- sm("",1);
- ShutDown();
- end();
- }
- pm("Enter Ratio >: ",image,4);
- ratio=atoi(image);
- pm("Enter Daily Download Byte Limit >: ",image,15);
- bytelimit=(ULONG)atol(image);
- sm("",1);
- DeleteFile(path);
- Rename(bbsroot,path);
- i=0;
- sm("Changing Conference Ratios & ByteLimit for ALL accounts.Please Standby.",1);
- fi=fopen(path,"rb");
- if(fi==NULL)
- {
- sm("",1);
- sm("Error Changing Data. Cannot Open Conf.DB.old",1);
- sm("",1);
- ShutDown();
- end();
- }
- fo=fopen(bbsroot,"wb");
- if(fo==NULL)
- {
- sm("",1);
- sm("Error Changing Data. Cannot Open Conf.DVB",1);
- fclose(fi);
- Rename(path,bbsroot);
- ShutDown();
- end();
- }
- while(fread((APTR)&CB,sizeof(struct ConfBase),1,fi)!=NULL)
- {
- CB.Ratio=ratio;
- CB.RatioType=ratiotype;
- CB.Daily_Bytes_Limit=bytelimit;
- i+=1;
- if(i==5) { sm(".",0); i=0; }
- fwrite((APTR)&CB,sizeof(struct ConfBase),1,fo);
- }
- sprintf(image,"%d",ratio);
- pu(image,DT_SECLIBRARY);
- sprintf(image,"%d",ratiotype);
- pu(image,DT_SECBOARD);
- sprintf(image,"%ld",bytelimit);
- pu(image,DT_DAILYBYTELIMIT);
- fclose(fi);
- fclose(fo);
- sm("",1);
- ShutDown();
- end();
- }
-
-
- void ShowIntro(void)
- {
- sm("",1);
- sm(" .------------------------------------------------------------------------.",1);
- sm(" | Ami-Express RATIOS Version 1.0 Written by ByteMaster |",1);
- sm(" | /X Development Team - The Silent Achievers |",1);
- sm(" `------------------------------------------------------------------------'",1);
- sm("",1);
- }
-
- void LastCommand(void)
- {
- sm("",1);
- sm("",1);
- }
- void end(void)
- {
- exit(0);
- }